package com.obs.ttltest;

import java.util.Arrays;

public enum CtCertInfoType {
    CA("CA"),
    SELF_SIGNED("self_signed");

    private String code;

    CtCertInfoType(String code) {
        this.code = code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return this.code;
    }

    public static CtCertInfoType getType(String value) {
        CtCertInfoType certType  = Arrays.stream(CtCertInfoType.values())
                .filter(type -> type.getCode().equals(value))
                .findFirst().orElse(null);
        return certType;
    }
}